﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Product.Domain.Entity
{
    public class Sku : BaseEntity
    {
        public Sku()
        {
        }

        public Sku(string spuId, string skuNo, int stock,string picUrl, string specification, decimal price, string unitId)
        {
            SpuId = spuId;
            SkuNo = skuNo;
            Stock = stock;
            PicUrl = picUrl;
            Specification = specification;
            Price = price;
            UnitId = unitId;
            SalesStatus = SalesStatus.OnShelf;
            CreateTime = DateTime.Now;
        }

        /// <summary>
        /// SpuId
        /// </summary>
        public string SpuId { get; set; }

        /// <summary>
        /// sku 编码
        /// </summary>
        public string SkuNo { get; set; }

        /// <summary>
        /// sku数量
        /// </summary>
        public int Stock { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        public string PicUrl { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string UnitId { get; set; }

        /// <summary>
        /// 销售状态
        /// </summary>
        public SalesStatus SalesStatus { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

    }

    public enum SalesStatus
    {
        [Description("上架")]
        OnShelf = 1,
        [Description("下架")]
        OffShelf = 2
    }
}
